package com.cskaoyan.controller;

import com.cskaoyan.bean.common.BaseRespVo;
import com.cskaoyan.bean.vo.AdminDashboardVO;
import com.cskaoyan.service.IndexService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 请求网址: http://182.92.235.201:8083/admin/dashboard
 *
 * @author wei
 * @since 2022/09/06 19:17
 * 首页
 */
@RestController
@RequestMapping("admin")
public class IndexController {
    @Autowired
    IndexService indexService;

    @GetMapping("dashboard")
    public BaseRespVo dashboard() {
        AdminDashboardVO adminDashboardVO = indexService.queryNum();
        BaseRespVo<Object> baseRespVo = new BaseRespVo<>();
        baseRespVo.setErrno(0);
        baseRespVo.setErrmsg("成功");
        baseRespVo.setData(adminDashboardVO);
        return baseRespVo;
    }
}

